package com.bao.work.video.service.impl;

import com.bao.work.video.entity.User;
import com.bao.work.video.enum1.Sex;
import com.bao.work.video.service.UserService;

/**
 * @author baoye
 * @date 2024-08-01/17:16
 */
public class UserServiceImpl implements UserService {
    static{
        USERS.add(new User("老蔡","123456789012345678", Sex.男,"武汉","oldV","123"));
        USERS.add(new User("蔡九","999999999999999999", Sex.男,"武汉","v9","123"));
        USERS.add(new User("蔡五","555555555555555555", Sex.男,"武汉","v5","123"));
    }
    @Override
    public boolean login() {
        System.out.print("请输入用户名:");
        String userName=INPUT.next();
        System.out.print("请输入密码:");
        String password=INPUT.next();
        for (User user : USERS) {
            if(user.getUserName().equals(userName)){
                if (user.getPassword().equals(password)){
                    return true;
                }
            }
        }
        return false;
    }
}
